﻿/**
 * Copyright (C) 2011 original author and authors
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Reflection;

namespace NGuice.Inject.Binder
{
    public interface ILinkedBindingBuilder<T>: IScopedBindingBuilder
    {
        IScopedBindingBuilder To();

        IScopedBindingBuilder To(Type implemention);

        IScopedBindingBuilder To(Key<T> targetKey);

        /// <summary>
        /// </summary>
        /// <param name="targetKey">泛型参数为T的子类</param>
        /// <returns></returns>
        IScopedBindingBuilder ToNoGenericKey(Key targetKey);
        
        void ToInstance(T instance);

        IScopedBindingBuilder ToProvider(IProvider<T> provider);

        IScopedBindingBuilder ToProvider(Key<IProvider<T>> key);

        /// <summary>
        /// Key必须具有泛型参数IProvider&ltT&gt
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        IScopedBindingBuilder ToProviderNoGenericKey(Key key);

        /// <summary>
        /// constructor必须是T子类的构造函数
        /// </summary>
        /// <param name="constructor"></param>
        /// <returns></returns>
        IScopedBindingBuilder ToConstructor(ConstructorInfo constructor);

        ///// <summary>
        ///// 
        ///// </summary>
        ///// <param name="constructor">constructor必须是T子类的构造函数</param>
        ///// <param name="subType">subType必须为构造器声明的类的子类</param>
        ///// <returns></returns>
        //IScopedBindingBuilder ToConstructor(ConstructorInfo constructor, Type subType);

    }
}
